﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace devtm.Applications.License
{

    public class LicenseModel
    {

        public Guid GuidApplication { get; set; }
        public Guid GuidUser { get; set; }

        public uint Crc 
        {
            get
            {

                byte[] a = GuidApplication.ToByteArray();
                byte[] b = GuidUser.ToByteArray();
                byte[] c = new byte[32];

                for (int i = 0; i < 16; i++)
                    c[i] = a[i];

                for (int i = 0; i < 16; i++)
                    c[ 16 + i] = b[i];


                return Crc32.Calculate(c);

            }
        }

    }

}
